home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19960209-19960425 / 000420_news@columbia.edu _Tue Apr 16 12:20:20 1996.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Return-Path: news@columbia.edu
  2. Received: from apakabar.cc.columbia.edu (apakabar.cc.columbia.edu [128.59.35.159]) by watsun.cc.columbia.edu (8.7.5/8.7.3) with ESMTP id MAA06504 for <kermit.misc@watsun>; Tue, 16 Apr 1996 12:20:20 -0400 (EDT)
  3. Received: (from news@localhost) by apakabar.cc.columbia.edu (8.7.5/8.7.3) id MAA27232 for kermit.misc@watsun; Tue, 16 Apr 1996 12:20:19 -0400 (EDT)
  4. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  5. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  6. Newsgroups: comp.protocols.kermit.misc
  7. Subject: Re: K95 script crawling
  8. Date: 16 Apr 1996 16:20:11 GMT
  9. Organization: Columbia University
  10. Lines: 45
  11. Message-ID: <4l0hbr$qij@apakabar.cc.columbia.edu>
  12. References: <Dpx2AL.8Ix@murdoch.acc.Virginia.EDU>
  13. NNTP-Posting-Host: watsun.cc.columbia.edu
  14.  
  15. In article <Dpx2AL.8Ix@murdoch.acc.Virginia.EDU>,
  16. George H. Payne <ghp5h@virginia.edu> wrote:
  17.  
  18. : The script below is basically a loop that looks for begin-print and
  19. : end-print print-through escape sequences and captures the stuff that is
  20. : supposed to be printing to a file, post.tmp.  Under msdos kermit, this
  21. : script runs at reasonable, if not terribly amazing, speed (it processes
  22. : a line per second or so).  Under K95 on a better computer running winNT
  23. : with nothing else running, it CRAWLS (one line every couple of minutes).
  24. : :loop
  25. : input 40 \{27}[5i
  26. : if failure goto endloop
  27. : log session post.tmp
  28. : input 40 \{27}[4i
  29. : if failure goto noendprint
  30. : close session
  31. : goto loop
  32. : :endloop
  33. Rewriting the script as shown below makes it go plenty fast -- many
  34. lines per second.  "XXXX" from host makes it exit:
  35.  
  36. set input echo off
  37. :loop
  38. minput 10 {\10} {\{27}[5i} {\{27}[4i} {XXXX}
  39. if success forward \v(minput)
  40. goto loop
  41. :1
  42. write screen \v(input)        ; Got a line, echo it.
  43. clear input            ; Clear the line from the buffer.
  44. goto loop            ; Go back and get another.
  45. :2
  46. log session x.tmp        ; Got "start printer"
  47. echo CAPTURING...
  48. goto loop
  49. :3
  50. close session            ; Got "stop printer"
  51. echo END CAPTURE...
  52. clear input
  53. goto loop
  54. :4
  55. end                ; Got XXXX
  56.  
  57. - Frank